import java.util.Scanner;

public class demo04 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int left=1;
        int right=Integer.MAX_VALUE;
        while (left<right){
            int mid=(left+right)/2;
            if(check(mid)>=n){
                right=mid;
            }else{
                left=mid+1;
            }
        }
        if(check(left)==n){
            System.out.println(left);
        }else {
            System.out.println(-1);
        }
    }
    public static int check(int n){
        int count=0;
        while (n!=0){
            count+=n/5;
            n/=5;
        }
        return count;
    }
}

